<?php
/**
 * calendar examples...
 *
 * @package com.bbqq
 * @author  Bruce Li <toughgamer@gmail.com>
 *
 * @copyright 2009 qstufie.com
 */
require 'calendar.php';
?>
<!DOCTYPE html><html>
<head>
<title>BBQQ CALENDAR</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<link href="styles/example.css" media="screen" rel="stylesheet" type="text/css" >
<body>
<h3>A plain calendar with all default settings</h3>
<?php
$cal = new BBQQ_Calendar();
$cal->render(0);
?>

<h3>A plain calenar with raw output, for geektool</h3>
<pre style="background:#333;width:420px;padding:12px;">
<?php
$cal->render(0, 1);
?>
</pre>

<h3>Customised Week Day Titles</h3>
<p>change sun/sat to sunday/saturday</p>
<?php
$cal->setWeekDayTitle(array(
    'sun' => 'Sunday',
    'sat' => 'Saturday'
));
$cal->render(0);
?>

<h3>Customised header</h3>
<?php
$cal->render(0, 0,
    '<tr><th colspan="7" style="background:#69c;">simple calendar</th></tr>' .
    '<tr><th>s</th><th>m</th><th>t</th><th>w</th><th>t</th><th>f</th><th>s</th></tr>'
);
?>

<h3>Hightlight Days With Customised Templates (Advanced Usage)</h3>
<?php
$days = array(
            // custom template for today
            $cal->getToday('j') => array(
                'template' => '<b>TODAY: :num</b>'
            ),
            // highlight day: 5 with custom template/scripts and wrapper tag
            5 => array(
                'template' => '<a href="event?id=event_:timestamp">:num</a>',
                'wrapper' => array(
                   'tag' => 'td',
                   'id'    => null,
                   'class' => 'cal-thu',
                   'format' => 'j F, Y',
                   'style' => 'color:red;background:yellow',
                   'onclick' => "alert('Title: ' + this.title);return false;",
                   'title' => ':title'
                )
            ),
            // highlight day: 12 with custom template and wrapper tag
            12 => array(
                'template' => '<a href="?id=event_:title">:num</a>',
                'wrapper' => array(
                   'tag' => 'td',
                   'id'    => null,
                   'class' => 'cal-thu',
                   'format' => 'j F, Y',
                   'style' => 'color:red;background:green',
                   'title' => 'some :title'
                )
            )
        );

$cal->highlightDays($days);
$cal->render(0);
?>
</body>
</html>